home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1990: Night of the Living Disc / Night of the Living Disc.hdv / Dev.CD.5 / Tools / Technical.Notes / GSOS / TN.GSOS.011 < prev    next >
Encoding:
Text File  |  1990-07-23  |  3.0 KB  |  68 lines  |  [04] ASCII Text (0x0000)

  1. Apple II
  2. Technical Notes
  3. _____________________________________________________________________________
  4.                                                   Developer Technical Support
  5.  
  6. GS/OS
  7. #11:    About EraseDisk and Format
  8.  
  9. Written by:    Dave Lyons & Matt Deatherage                         July 1990
  10.  
  11. This Technical Note explains how an application can tell when a user chooses 
  12. Cancel from an EraseDisk or Format dialog box and explains why the file_sys_ID 
  13. field is ignored in class-zero calls.
  14. _____________________________________________________________________________
  15.  
  16. Detecting a Canceled Erase or Format Dialog Box
  17.  
  18. GS/OS Reference says that EraseDisk and Format return with the carry flag set 
  19. and A equal to zero when the user cancels the operation.  This is great, 
  20. except that the calls actually return with the carry clear, making a Cancel 
  21. hard to distinguish from a successful EraseDisk or Format operation.  This 
  22. happens in System Software 5.0.2 and earlier; it will eventually be changed to 
  23. work as documented in GS/OS Reference.
  24.  
  25. In the mean time, this Note presents a safe way around the problem (it will 
  26. keep working even after the system software is changed):
  27.  
  28.   1.  In the parameter block for class-one EraseDisk or Format, set the 
  29.       fileSysID field to 0.  (See note below.)
  30.   2.  Make the call.
  31.   3.  If the error code is non-zero, there was an error.  Handle it.
  32.   4.  Otherwise, the error code is zero.  Check the fileSysID field in 
  33.       the parameter block.  If it is still zero, the user chose to 
  34.       cancel the operation.
  35.  
  36. Note that this method only works for class-one calls. For the class-zero 
  37. ERASE_DISK and FORMAT calls, the file_sys_ID word is only an input 
  38. parameter and always remains unchanged.
  39.  
  40.  
  41. About the Class-Zero file_sys_ID Parameter
  42.  
  43. Even though fileSysID is an input parameter for the class-zero calls 
  44. ERASE_DISK and FORMAT, all versions of the system software ignore the supplied 
  45. value and always give the user a dialog for selecting a file system.  This 
  46. means no functionality is lost by putting a zero there.
  47.  
  48. The reasons for this decision are historical.  Although the Apple IIgs ProDOS 
  49. 16 Reference indicates that the input parameter file_sys_ID would be used in 
  50. future versions to choose destination file systems, ProDOS 16 always returned 
  51. an error if the file system specified was not $0001 (ProDOS).
  52.  
  53. Since this effectively means no ERASE_DISK or FORMAT call can be made under 
  54. ProDOS 16 with any file_Sys_ID other than $0001, the GS/OS team chose to 
  55. ignore the parameter and always give users the choice when using class zero 
  56. calls.  Otherwise, no program that existed when GS/OS was released would ever 
  57. allow users to choose interleaves or file systems (they would always format 
  58. for ProDOS, file system $0001).  (Note that the class-one Format and EraseDisk 
  59. calls have a new reqFileSysID parameter; if this field is present, the dialog 
  60. box is bypassed.)
  61.  
  62.  
  63. Further Reference
  64. _____________________________________________________________________________
  65.   o  GS/OS Reference
  66.   o  Apple IIgs ProDOS 16 Reference
  67.  
  68.